home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Freelog Special Edition 13
/
FreelogHS13.iso
/
P To P
/
Emule24b_Morph_Mod_V4b-binary
/
Webserver
/
menu.js
< prev
next >
Wrap
Text File
|
2002-12-04
|
3KB
|
99 lines
var oContentmenu=new Array();
function createContentMenu(width)
{
var num=oContentmenu.length;
num++;
var str='<div id="divContentMenu'+num+'" class="clContentMenu"></div>';
document.write(str);
oContentmenu[num]=new lib_obj('divContentMenu'+num,"","","",num);
oContentmenu[num].id=num;
oContentmenu[num].x=0;
oContentmenu[num].y=0;
oContentmenu[num].width=width;
oContentmenu[num].xOffset=0;
oContentmenu[num].yOffset=0;
oContentmenu[num].content="";
oContentmenu[num].timer=false;
oContentmenu[num].stillin=false;
oContentmenu[num].show=menuShow;
oContentmenu[num].hide=menuHide;
oContentmenu[num].over=menuOver;
oContentmenu[num].addMenuElement=addMenu;
oContentmenu[num].elementCount=0;
oContentmenu[num].alterContent=menuContent;
oContentmenu[num].evnt.onmouseover=new Function("oContentmenu["+num+"].over();")
oContentmenu[num].evnt.onmouseout=new Function("oContentmenu["+num+"].hide();")
return oContentmenu[num];
}
function menuShow()
{
this.moveIt(this.x+this.xOffset,this.y+this.yOffset);
this.showIt();
this.timer=false;
this.stillin=true;
return false;
}
function menuOver()
{
this.stillin=true;
if(this.timer!=false)
{
clearTimeout(this.timer);
this.timer=false;
}
return false;
}
function menuHide()
{
if(this.stillin==true)
{
this.stillin=false;
this.timer=setTimeout("oContentmenu["+this.id+"].hide();",500);
}
else
this.hideIt();
return false;
}
function menuContent(content)
{
setContent(content,"divContentMenu"+this.id);
}
function addMenu(name,action,highlight,overaction,outaction)
{
if(name)
{
this.content+='<table border="0" cellspacing="0" cellpadding="0" id="menu'+this.id+'_'+this.elementCount+'" '
+'onClick="'+action+'" width="'+this.width+'"';
if(highlight)
{
this.content+=' onMouseover="menu'+this.id+'_'+this.elementCount+'.style.setAttribute(\'backgroundcolor\',\'black\',false);menu'+this.id+'_'+this.elementCount+'.style.color=\'white\';';
if(overaction)
this.content+=overaction;
this.content+='" onMouseout="menu'+this.id+'_'+this.elementCount+'.style.removeAttribute(\'backgroundcolor\',false);menu'+this.id+'_'+this.elementCount+'.style.color=\'black\';';
if(outaction)
this.content+=outaction;
this.content+='"';
}
else
{
if(overaction)
this.content+=' onMouseover="'+overaction+'"';
if(outaction)
this.content+=' onMouseout="'+outaction+'"';
}
this.content+='><tr><td><a class="clContentMenuText"><nobr>'+name+'</nobr></a></td></tr></table>';
}
else
this.content+='<hr width="'+this.width+'"/>';
this.alterContent(this.content);
this.elementCount++;
}